// ajax数据请求

let rootURL = "http://localhost:8080"
function getData(url,optipns){
  return new Promise((resl,rej)=>{
    wx.request({
      url: rootURL+url,
      data:optipns,
      success:res=>{
        resl(res.data)
      }
    })
  })
}

// 获取banner
let get_banner = options => getData("/banner/index/bannerList",options)

// 获取歌手列表
let get_singerList = options => getData("/artist/artistInfo",options)

// 获取歌手介绍
let get_artistIntroduce = options => getData("/artist/artist",options)

// 获取歌手单曲
let get_music = options => getData("/artist/artistMusic",options)

// 获取播放地址
let get_musicUrl = options => getData("/api/v1/www/music/playUrl",options)

// 获取搜索联想
let get_searchKey = options => getData("/search/searchKey",options)

// 获取搜索列表
let get_searchMusic = options => getData("/search/searchMusicBykeyWord",options)

module.exports = {
  get_banner,
  get_singerList,
  get_artistIntroduce,
  get_music,
  get_musicUrl,
  get_searchKey,
  get_searchMusic
}